﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CubePuzzle
{
    public class Item
    {
        private int[][][] item;
        private int n;

        private int x;
        private int y;
        private int z;

        public void setX(int x) {
            this.x = x;
        }

        public void setY(int y)
        {
            this.y = y;
        }

        public void setZ(int z)
        {
            this.z = z;
        }

        public int getX()
        {
            return x;
        }

        public int getY()
        {
            return y;
        }

        public int getZ()
        {
            return z;
        }

        public Item(int n)
        {
            this.n = n;
            item = new int[n][][];
            for (int i = 0; i < n; i++)
            {
                item[i] = new int[n][];
            }

            for (int i=0; i < n; i++)
                for (int j = 0; j < n; j++)
                {
                    item[i][j] = new int[n];
                }

        }

        public void setItem(int i, int j, int k, int value) 
        {
            if ((i > -1) && (i < n) && (j > -1) && (j < n) && (k > -1) && (k < n))
            {
                item[i][j][k] = value;
            }
        }

        public int getItem(int i, int j, int k)
        {
            return item[i][j][k];
        }

        public int getDim()
        {
            return n;
        }
    }
}
